/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dds2.serviceSystem.Dao;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import mx.its.dds2.ServicesSystem.Modelo.Usersystem;

/**
 *
 * @author Carlos Asis
 */
@Stateless
public class UsersystemDao extends AbstractFacade<Usersystem> implements UsersystemDaoLocal {

    @PersistenceContext(unitName = "servicesSystem-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public UsersystemDao() {
        super(Usersystem.class);
    }

    @Override
    public Boolean FindDuplecity(Usersystem user) {
//       Query q=em.createNamedQuery("Usersystem.findDuplicity") ;
//       q.setParameter("name", user.getName());
//       q.setParameter("firstName", user.getFirstName());
//       q.setParameter("lastName", user.getLastName());
//       return !q.getResultList().isEmpty();
        return true;
    }
}
